<div class="row block">
    <div class="panel panel-primary">
        <div class="panel-heading">
            <span class="panel-controls">
                <button class="btn btn-primary" uib-tooltip="关闭" ng-click="createimages.cancel()"><i class="fa fa-times" aria-hidden="true"></i></button>
            </span>
            <h5>{{createimages.title}}</h5>
        </div>
        <div class="panel-body">
            <div class="pt20">
                <div>
                    <div class="form-group admin-form">
                        <form class="form-horizontal" name="myForm" novalidate>
                               <div class="row" ng-show="createimages.title=='编辑镜像'">
                                    <div class="col-sm-10 form-group">
                                        <label class="col-sm-3 control-label">编号</label>
                                        <div class="col-sm-9">
                                            <input type="text" disabled="disabled" class="form-control" name="addGroup" ng-minlength="2" ng-model="createimages.postData.id">
                                        </div>
                                    </div>
                                </div>

                               <div class="row" ng-show="!createimages.ciid">
                                    <div class="col-sm-10 form-group">
                                        <label class="col-sm-3 control-label">名称</label>
                                        <div class="col-sm-9">
                                            <input type="text" class="form-control" name="addGroup" ng-minlength="2" ng-model="createimages.postData.name" required>
                                        </div>
                                    </div>
                                </div>
                                <div class="row" ng-show="!createimages.ciid">
                                    <div class="col-sm-10 form-group">
                                        <label class="col-sm-3 control-label">描述</label>
                                        <div class="col-sm-9">
                                            <input type="text" class="form-control" name="addGroup" ng-minlength="2" ng-model="createimages.postData.describe" required>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-10 form-group">
                                        <label class="col-sm-3 control-label">授权</label>
                                        <div class="col-sm-9">
                                            <div class="admin-form">
                                                <div class="option-group field" >
                                                    <label class="option option-primary">
                                                        <input type="radio" ng-model="createimages.postData.share" value="false" >
                                                        <span class="radio" style="padding-top: 0;min-height: 0"></span>私人
                                                    </label>
                                                    <label class="option option-primary">
                                                        <input type="radio" ng-model="createimages.postData.share" value="true" >
                                                        <span class="radio" style="padding-top: 0;min-height: 0"></span>共享给我的组织
                                                    </label>
                                                </div>
                                            </div>
                                        </div>

                                    </div>
                                </div>


                                <div ng-if="createimages.imagesid" class="row">
                                    <hr>
                                    <div class="col-sm-10 form-group">
                                        <label class="col-sm-3 control-label">镜像文件信息</label>
                                        <label ng-if="createimages.uploadstatus.status=='1'" class="col-sm-9 control-label" style="text-align: left" >上传时间:{{createimages.uploadstatus.time}} 镜像大小:{{createimages.bytesToSize(createimages.uploadstatus.size)}}</label>
                                        <div ng-if="createimages.uploadstatus.status=='0'" class="col-sm-9">
                                            <div class="admin-form">
                                                <div class="option-group field" >
                                                    <div>
                                                        <input type="file" class="newFile" id="choicefilesx" style="display: none" onchange="angular.element(this).scope().upForm()" multiple="multiple" />
                                                        <input type="hidden" name="newFileMsg" data-name=""/>
                                                        <button class="btn btn-primary" ng-click="createimages.clickImport()" >
                                                            <span class="glyphicon glyphicon-upload" style="padding: 0 3px;"></span>上传镜像
                                                        </button>
                                                    </div>
                                                    <div style="display: none;" id="upload_progressBar_Module">
                                                        <div class="progress">
                                                            <div class="progress-bar" id="upload_progressBar" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0" style="width:0;" >
                                                            </div>
                                                        </div>
                                                        <span id="percentage"></span><span id="time"></span>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div ng-if="createimages.imagesid" class="row">
                                    <hr>
                                    <div class="panel-body" >
                                        <div style="padding: 10px">
                                            <span style="font-size: 14px;font-weight: bold; color: #626262">1. 安装AGENT:</span>
                                            <span style="color: red">curl -L http://{{createimages.siteaddr}}/api/scripts/installAgent.sh |sudo OPEN_C3_ADDR={{createimages.siteaddr}} bash </span>
                                        </div>
                                    </div>
 
                                    <div class="panel-body" >
                                        <div style="padding: 10px">
                                            <span style="font-size: 14px;font-weight: bold; color: #626262">2. 添加公钥:</span>
                                            <span style="color: red">wget http://{{createimages.siteaddr}}/api/ci/images/{{createimages.imagesid}}/sshkey.pub -O /opt/mydan/etc/agent/auth/c3_ci_{{createimages.imagesid}}.pub </span>
                                        </div>
                                    </div>
                                </div>

                                <div class="row" ng-show="createimages.type!='show'">
                                    <div class="col-sm-5 form-group pull-right">
                                        <button class="btn btn-primary" ng-disabled="!( createimages.postData.describe && createimages.postData.name )" ng-click="createimages.saveImages()">保存镜像</button>
                                    </div>
                                </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
